package com.nativetalk.dao;

import com.nativetalk.bean.*;
import com.nativetalk.bean.FoundChange.TdNtMembFoundChangeInset;
import com.nativetalk.bean.FoundChange.TdNtTeaFoundChangeInsert;
import com.nativetalk.bean.member.TdNtMember;
import com.nativetalk.bean.member.TdNtMemberDetailOrders;
import com.nativetalk.bean.member.TdNtMemberStudyTimes;
import com.nativetalk.bean.member.course.TdNtMembCourseDetail;
import com.nativetalk.bean.member.setmeal.TdNtMembSetmealDetail;
import com.nativetalk.bean.member.setmeal.his.TdNtSetmealUseHisInsert;
import com.nativetalk.bean.purchase.TdNtMembPurchaseChange;
import com.nativetalk.bean.study.TdNtStudyTeachInsert;
import com.nativetalk.bean.study.TdNtStudyTeachUpdate;
import com.nativetalk.bean.teacher.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by lizhun on 16/1/9.
 * Modified by wangzheng on 17/02/28
 */
@Repository
public interface TdNtLiveDao {
    /**
     * @Purpose  送礼物
     * @version  3.0
     * @author   lizhun
     * @param    tdNtLiveGivingHistory
     * @return   void
     */
    public void insertTdNtLiveGivingHistory(TdNtLiveGivingHistory tdNtLiveGivingHistory);
    /**
     * @Purpose  添加点亮
     * @version  3.0
     * @author   lizhun
     * @param    tdNtLiveLightHistory
     * @return   void
     */
    public void insertTdNtLiveLightHistory(TdNtLiveLightHistory tdNtLiveLightHistory);
    /**
     * @Purpose  根据用户id更新用户余额
     * @version  3.0
     * @author   lizhun
     * @param    tdNtMember
     * @return   void
     */
    public void updateTdNtMemberBalance(TdNtMember tdNtMember);
    /**
     * @Purpose  根据用户id查找用户
     * @version  3.0
     * @author   lizhun
     * @param    memb_id
     * @return   TdNtMember
     */
    public TdNtMember findTdNtMember(int memb_id);
    /**
     * @Purpose  添加用户资金变动记录
     * @version  3.0
     * @author   lizhun
     * @param    tdNtMembFoundChangeInset
     * @return   void
     */
    public void insertTdNtMembFoundChange(TdNtMembFoundChangeInset tdNtMembFoundChangeInset);
    /**
     * @Purpose  查找所有的购买直播的人
     * @version  3.0
     * @author   lizhun
     * @param    live_cou_his_id
     * @return   List<TdNtMember>
     */
    public List<TdNtMember> findTdNtMemberByLive(int live_cou_his_id);
    /**
     * @Purpose  查找直播老师
     * @version  3.0
     * @author   lizhun
     * @param    live_cou_his_id
     * @return   TdNtTeacherResult
     */
    public TdNtTeacherResult findTdNtTeacher(int live_cou_his_id);
    /**
     * @Purpose  添加教师资金变动记录
     * @version  3.0
     * @author   lizhun
     * @param    tdNtTeaFoundChangeInsert
     * @return   void
     */
    public void insertTdNtTeaFoundChangeInsert(TdNtTeaFoundChangeInsert tdNtTeaFoundChangeInsert);
    /**
     * @Purpose  查找教师首页数据
     * @version  3.0
     * @author   lizhun
     * @param    tea_id
     * @return   TdNtTeacherIndex
     */
    public TdNtTeacherIndex findTdNtTeacherIndex(Integer tea_id);
    /**
     * @Purpose  更新教师余额及教学时长
     * @version  3.0
     * @author   lizhun
     * @param    tdNtTeacherIndex
     * @return   void
     */
    public void updateTdNtTeacherIndex(TdNtTeacherIndex tdNtTeacherIndex);
    /**
     * @Purpose  根据课程查找用户套餐信息
     * @version  1.0
     * @author   lizhun
     * @param    map
     * @return   TdNtMembSetmealState
     */
    public TdNtMembSetmealDetail findTdNtMembSetmealDetail(Map<String,Object> map);
    /**
     * @Purpose  添加学习记录
     * @version  1.0
     * @author   lizhun
     * @param    tdNtStudyTeachInsert
     * @return   void
     */
    public void insertTdNtStudyTeach(TdNtStudyTeachInsert tdNtStudyTeachInsert);
    /**
     * @Purpose  查找学习的当前页数
     * @version  1.0
     * @author   wuyuanhui
     * @param    tdNtMembCourse
     * @return   TdNtStudyTeachToComment
     */
    public TdNtMembCourseDetail findTdNtMembCourseDetail(TdNtMembCourseDetail tdNtMembCourse);
    /**
     * @Purpose  根据课程id查找所有可接单的教师
     * @version  1.0
     * @author   lizhun
     * @param    map
     * @return   void
     */
    public List<TdNtTeacherGetui> findTdNtTeacherByCouId(Map<String,Object> map);
    /**
     * @Purpose  根据学习id查找用户学习记录接单用
     * @version  1.0
     * @author   lizhun
     * @param    stt_id
     * @return   TdNtStudyTeachUpdate
     */
    public TdNtStudyTeachUpdate findTdNtStudyTeachUpdate(Integer stt_id);
    /**
     * @Purpose  根据课程id随机查找所有可接单的教师
     * @version  1.0
     * @author   lizhun
     * @param    map
     * @return   void
     */
    public List<TdNtTeacherGetui> findTdNtTeacherByCouIdRound(Map<String,Object> map);
    /**
     * @Purpose  查找教师首页数据添加学习记录用
     * @version  1.0
     * @author   lizhun
     * @param    tea_id
     * @return   TdNtTeacherStudyInsert
     */
    public TdNtTeacherStudyInsert findTdNtTeacherStudyInsert(Integer tea_id);
    /**
     * @Purpose  更新教学记录(取消时用)
     * @version  1.0
     * @author   lizhun
     * @param    tdNtStudyTeachUpdate
     * @return   void
     */
    public void updateTdNtStudyTeachCancel(TdNtStudyTeachUpdate tdNtStudyTeachUpdate);
    /**
     * @Purpose  根据教师id查找老师
     * @version  2.0
     * @author   lizhun
     * @param    tea_id
     * @return   void
     */
    public TdNtTeacherGetui findTdNtTeacherByTeaId(Integer tea_id);
    /**
     * @Purpose  更新用户教学开关
     * @version  1.0
     * @author   lizhun
     * @param    tdNtTeacherState
     * @return   void
     */
    public void updateTdNtTeacherState(TdNtTeacherState tdNtTeacherState);
    /**
     * @Purpose  更新套餐剩余时长
     * @version  1.0
     * @author   lizhun
     * @param    tdNtMembSetmealDetail
     * @return   TdNtMembSetmealState
     */
    public void udpateTdNtMembSetmealDetail(TdNtMembSetmealDetail tdNtMembSetmealDetail);
    /**
     * @Purpose  添加套餐使用记录
     * @version  1.0
     * @author   lizhun
     * @param    tdNtSetmealUseHisInsert
     * @return   void
     */
    public void insertTdNtSetmealUseHis(TdNtSetmealUseHisInsert tdNtSetmealUseHisInsert);
    /**
     * @Purpose  更新教学记录(结束时用)
     * @version  1.0
     * @author   lizhun
     * @param    tdNtStudyTeachUpdate
     * @return   void
     */
    public void updateTdNtStudyTeachEnd(TdNtStudyTeachUpdate tdNtStudyTeachUpdate);
    /**
     * @Purpose
     * @Purpose  添加课程
     * @version  2.0
     * @author   lizhun
     * @param    tdNtMembCourseDetail
     * @return   void
     */
    public void insertTdNtMembCourse(TdNtMembCourseDetail tdNtMembCourseDetail);
    /**
     * @Purpose
     * @Purpose  更新课程
     * @version  2.0
     * @author   lizhun
     * @param    tdNtMembCourseDetail
     * @return   void
     */
    public void updateTdNtMembCourse(TdNtMembCourseDetail tdNtMembCourseDetail);
    /**
     * @Purpose  更新课程已学人数
     * @version  1.0
     * @author   lizhun
     * @param    map
     * @return   void
     */
    public void updateTsNtCourseInfoStudySize(Map<String, Object> map);
    /**
     * @Purpose  根据用户id 查找用户学习时间
     * @version  2.0
     * @author   lizhun
     * @param    memb_id
     * @return   TdNtMemberStudyTimes
     */
    public TdNtMemberStudyTimes findTdNtMemberStudyTimes(int memb_id);
    /**
     * @Purpose  根据用户id更新用户学习时间
     * @version  2.0
     * @author   lizhun
     * @param    tdNtMemberStudyTimes
     * @return   void
     */
    public void updateTdNtMemberStudyTimes(TdNtMemberStudyTimes tdNtMemberStudyTimes);
    /**
     * @Purpose  更新教学记录
     * @version  1.0
     * @author   lizhun
     * @param    tdNtStudyTeachUpdate
     * @return   void
     */
    public void updateTdNtStudyTeach(TdNtStudyTeachUpdate tdNtStudyTeachUpdate);
    /**
     * @Purpose  根据用户id查找用户
     * @version  1.0
     * @author   lizhun
     * @param    memb_id
     * @return   TdNtMemberDetail
     */
    public TdNtMemberDetailOrders findTdNtMemberDetailOrders(Integer memb_id);
    /**
     * @Purpose  根据学习id查找用户信息
     * @version  3.0
     * @author   lizhun
     * @param     stt_id
     * @return    TdNtMember
     */
    public TdNtMember findTdNtMemberBySttId(int stt_id);
    /**
     * @Purpose  根据预约id查找预约信息
     * @version  3.0
     * @author   lizhun
     * @param     reserve_id
     * @return    TdNtReserve
     */
    public TdNtReserve findTdNtReserveById(int reserve_id);
    /**
     * @Purpose  新增预约上课历史记录
     * @version  3.0
     * @author   lizhun
     * @param     tdNtReserveHistory
     * @return    TdNtReserve
     */
    public void insertTdNtReserveHistory(TdNtReserveHistory tdNtReserveHistory);
    /**
     * @Purpose  根据学习id查找预约上课记录
     * @version  3.0
     * @author   lizhun
     * @param     stt_id
     * @return    TdNtReserve
     */
    public TdNtReserveHistory findTdNtReserveHistoryBySttId(int stt_id);
    /**
     * @Purpose  更新预约上课记录
     * @version  3.0
     * @author   lizhun
     * @param     tdNtReserveHistory
     * @return    void
     */
    public void updateTdNtReserveHistory(TdNtReserveHistory tdNtReserveHistory);
    /**
     * @Purpose  拒绝接单
     * @version  3.0
     * @author   lizhun
     * @param     map
     * @return    void
     */
    public void updateTdNtStudyTeachTeacher(Map<String,Integer> map);
    /**
     * @Purpose  学生拒绝接单
     * @version  3.0
     * @author   lizhun
     * @param     map
     * @return    void
     */
    public void updateTdNtStudyTeachStudent(Map<String,Integer> map);
    /**
     * @Purpose  添加用户内购资金变动记录
     * @version  3.0
     * @author   lizhun
     * @param    tdNtMembPurchaseChange
     * @return   void
     */
    public void insertTdNtMembPurchaseChange(TdNtMembPurchaseChange tdNtMembPurchaseChange);
    /**
     * @Purpose  更新用户内购余额
     * @version  3.1
     * @author   lizhun
     * @param    tdNtMember
     * @return   void
     */
    public void updateMemberPurchase(TdNtMember tdNtMember);
    /**
     * @Purpose  查找课程已上时间
     * @version  3.0
     * @author   lizhun
     * @param     reserve_id
     * @return    int
     */
    public int findReserveTime(int reserve_id);
    /**
     * @Purpose  查找已领取优惠券金额
     * @version  3.1
     * @author   lizhun
     * @param    tdNtCoupon
     * @return    int
     */
    public TdNtCoupon findTdNtCoupon(TdNtCoupon tdNtCoupon);
    /**
     * @Purpose  更新用户优惠券
     * @version  3.1
     * @author   lizhun
     * @param    tdNtCoupon
     * @return   void
     */
    public void updateTdNtCoupon(TdNtCoupon tdNtCoupon);
    /**
     * @Purpose  根据课程id随机查找所有可接单的教师
     * @version  1.0
     * @author   lizhun
     * @param    map
     * @return   void
     */
    public List<TdNtTeacherGetui> findTdNtTeacherByFreeRound(Map<String,Object> map);
    /**
     * @Purpose  更新频道
     * @version  4.0
     * @author   lizhun
     * @param    tdNtStudyTeachInsert
     * @return   void
     */
    public void updateTdNtStudyTeachChannel(TdNtStudyTeachInsert tdNtStudyTeachInsert);

    /**
     * @Purpose  更新直播状态
     * @version  4.1
     * @author   wangzheng
     * @param    map
     * @return   void
     */
    public void updateTdNtLiveMemb(Map<String,Object> map);

    /**
     * @Purpose  正在排队(举手)的人数
     * @version  4.1
     * @author   wangzheng
     * @param    live_cou_his_id
     * @return   int
     */
    public int findTdNtLiveMembWaitCount(int live_cou_his_id);

    /**
     * @Purpose  正在上麦的人数
     * @version  4.1
     * @author   wangzheng
     * @param    live_cou_his_id
     * @return   int
     */
    public int findTdNtLiveMembTalkCount(int live_cou_his_id);

    /**
     * @Purpose  根据预约id查找学生信息
     * @version  4.1
     * @author   wangzheng
     * @param    reserve_id
     * @return   TdNtMember
     */
    public TdNtMember findTdMembByReserveId(int reserve_id);
}
